<template>
  <div id="app" class="vir-root">
    <router-view />
  </div>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import { session, local } from '@/plugins/storage';

@Component
export default class AppPage extends Vue {
  private timer!: number;

  private created() {
    if (!this.$user.vaild() && this.$route.path !== 'login') {
      this.$router.push('/login');
    }

    this.timer = setInterval(() => {
      this.$user.refresh();
    }, 5 * 60 * 1000);
  }
}
</script>